<cfparam name="OAP_ID" type="integer" default="0" />
<cfparam name="returnView" type="string" default="users" />
<cfparam name="passback" type="string" default="" />

<cfscript>
	oapGateway = new assets.calgrants.com.gateway.OAPGateway();
	oap = oapGateway.get(OAP_ID = OAP_ID, Program_Year = request.currentProgramYear);
</cfscript>

<cfif oap.getOAP_ID() gt 0>

	<cfscript>
		base = new assets.calgrants.com.Base();
		passbackQueryString = base.passbackToQueryString(passback);
		oapValueGateway = new assets.calgrants.com.gateway.OAPValueGateway();
		oapValues = oapValueGateway.query(oapValueIDs = oap.getOAP_Value_IDs());
	</cfscript>

	<script type="text/javascript" language="javascript">
	<!--
		$(function() {
			$("#oapModal").modal();
			resizeModal("oapModal");
		})
	//-->
	</script>

	<div id="oapModal" class="modal modal-fullscreen" data-backdrop="static">
		<div class="modal-header">
			<h3>Outreach Action Plan</h3>
		</div>
		<div class="modal-body">
			<div class="container-fluid">
				<!--- <div class="row-fluid">
					<div class="span12">
						<cfoutput>
							<!--- <div class="text-control">
								<label>Program Year</label>
								#oap.getProgram_Year()#
							</div> --->
							<div class="text-control">
								<label>Number of workshops you will conduct</label>
								#oap.getWorkshop_Count()#
							</div>
							<div class="text-control">
								<label>Anticipated total number of students your workshop(s) will assist</label>
								#oap.getStudent_Target()#
							</div>
						</cfoutput>
					</div>
				</div> --->
				<div class="row-fluid">
					<div class="span12">
						<cfoutput query="oapValues" group="Category">
							<div class="text-control">
								<h4>#Category#</h4>
								<div class="well well-framed">
									<cfoutput group="Subcategory">
										<cfif Len(Trim(Subcategory)) gt 0><h5>#Subcategory#</h5></cfif>
											<cfoutput>
												<ul style="list-style-type: disc">
													<cfset itemIndex = ListFind(oap.getOAP_Value_IDs(), OAP_Value_ID)>
													<cfif itemIndex gt 0>
														<li style="margin-top: 5px;">#Description#</li>
													</cfif>
												</ul>
											</cfoutput>
									</cfoutput>
									<cfif Category eq "Campus Outreach Activities" AND Len(Trim(oap.getCampus_Other())) gt 0>
										<h5>Other Campus Outreach</h5>
										<ul style="list-style-type: disc">
											<li style="margin-top: 5px;">#oap.getCampus_Other()#</li>
										</ul>
									<cfelseif Category eq "Outreach to Parents" AND Len(Trim(oap.getParent_Other())) gt 0>
										<h5>Other Parent Outreach</h5>
										<ul style="list-style-type: disc">
											<li style="margin-top: 5px;">#oap.getParent_Other()#</li>
										</ul>
									<cfelseif Category eq "Outreach to Community Partners" AND Len(Trim(oap.getCommunity_Partner_Other())) gt 0>
										<h5>Other Community Partner Outreach</h5>
										<ul style="list-style-type: disc">
											<li style="margin-top: 5px;">#oap.getCommunity_Partner_Other()#</li>
										</ul>
									</cfif>
								</div>
							</div>
						</cfoutput>
					</div>
				</div>
			</div>
		</div>
		<div class="modal-footer">
			<cfoutput>
				<a class="btn btn-success" href="?view=#returnView#&#passbackQueryString#">Close</a>
			</cfoutput>
		</div>
	</div>

<cfelse>

	<div class="alert alert-info notFound">Outreach Action Plan not found or insufficient permissions to perform this operation</div>

</cfif>





<!--- <cfset organization = application.organizationGateway.get(organizationID)>
<cfwddx action="wddx2cfml" input="#organization.getOAP()#" output="OAP">
<cfset oapValues = application.organizationGateway.getOAPValues(OAP.oapValueIDs)>

<cfoutput>

	<cfif NOT printable>
		<div class="buttonBar">
			<a href="#script_name#?view=#rv#&organizationID=#organizationID#" class="formLink2">Back</a>
			&nbsp;&nbsp;<a href="#script_name#?view=OAP&organizationID=#organizationID#&printable=true" target="_blank"><img src="/applications/admin/common/images/printer.png" height="16" width="16" border="0"> Printable version</a>
		</div>
	</cfif>
	
	<h2>Student Target</h2>
		
	<div class="h2Content">
		
		<p>Number of students your workshop will assist:&nbsp;&nbsp;#OAP.studentTarget#</p>
		
	</div>
	
</cfoutput>
	
<cfoutput query="oapValues" group="OAP_Group">
	<h2>#OAP_Group#</h2>
	
	<div class="h2Content">
		<ul>
			<cfoutput>
				<li>#description#</li>
			</cfoutput>
			<cfset otherVal = "other#Replace(OAP_Group, ' ', '', 'all')#">
			<cfif Len(Trim(Evaluate("OAP.#otherVal#"))) gt 0>
				<li>#Evaluate("OAP.#otherVal#")#</li>
			</cfif>
		</ul>
		
	</div>
</cfoutput> --->